Repository navigation
device_memory_report: Switch traces to vulkan.memory_tracker event stream - #59
Merged
Merged
Conversation
The DebugMarker layer now records object names with process IDs and lifetime tracking, and trace consumers read them directly alongside allocation events. Publishing names here as well adds trace overhead and leaves two naming paths to maintain. Drop the debug naming intercepts, naming extension advertisement, and session-start name replay so DebugMarker acts as the sole producer. Keep the memory report extension advertisement and its device-creation fallback guard intact so drivers without that extension do not fail. Bug: b/564416621
Track events write annotation keys and string values in full on every packet, inflating trace size. Perfetto imports vulkan.memory_tracker packets directly into its standard allocation table with interned strings. Register that data source, emit one native packet per allocation or binding event, and intern keys and clusters per sequence. Replay live allocations at one shared timestamp on session start while holding back racing live events. Usage counter removal follows in the next change. Bug: b/564416621
Trace consumers can compute per-cluster application, unbound, and driver totals directly from the allocation stream. Maintaining running counter tracks in the layer duplicates that work and adds trace volume. Delete the usage counter tracks, interval-union bookkeeping, counter replay at session start, and the remaining track-event category so the layer writes only allocation events. Keep suballocation tracking, binding clamping, and driver cluster resolution needed for those events. Bug: b/564416621
jimblacklercorp
force-pushed
the
push-unwsmznntkoy
branch
from
November 29, 2026 23:24
ad5a9e0 to
338c935
Compare
olehkuznetsov
requested changes
Nov 30, 2026
olehkuznetsov
left a comment
There was a problem hiding this comment.
device_memory_report: Include thread names on recorded events
Native memory events carry only thread IDs, unlike track events which
emitted full thread descriptors. Without CPU scheduling options enabled,
recordings lacked the thread names users rely on to distinguish
application allocations from driver work.
Bindings recorded against a placeholder allocation (before its VkDeviceMemory size is known) emit OP_BIND live, and derived usage series rely on those bindings being present at session start. ReplayLiveAllocations skipped the entire entry when total_size == 0, dropping those live bindings. Keep skipping OP_CREATE for size-0 placeholders while still replaying their OP_BIND suballocations. Bug: b/564416621
jimblacklercorp
force-pushed
the
push-unwsmznntkoy
branch
from
November 30, 2026 14:30
338c935 to
a73a731
Compare
olehkuznetsov
self-requested a review
November 30, 2026 14:36
olehkuznetsov
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves
VK_LAYER_GOOGLE_DeviceMemoryReportto nativevulkan.memory_trackerpackets to trace Vulkan allocations directly in Perfetto without duplicating derived counters or object names.Changes
vulkan.memory_tracker: Emit nativeVulkanMemoryEventpackets withclusterannotations and per-sequence interned strings, and replay live state at session start.thread_nameannotations to preserve thread context without ftrace overhead.DebugMarkerserves as the single source for object names.OP_CREATEon size-0 placeholder blocks only whentotal_size > 0so mid-run attach replays do not overwrite bound resource records.Testing
ctest(test_DeviceMemoryReport_layer,test_DeviceMemoryReport_dispatch,test_DebugMarker_layer, etc.).VkCube, cold start and mid-run attach) with Sherlock andvulkan-memory-report.Bug: b/564416621